<?php
class ModelNewsNews extends Model {
	public function getAllNewsLimit($start,$limit)
	{
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "news ORDER BY create_date DESC LIMIT ". (int)$start . "," . (int)$limit);
		return $query->rows;
	}
	public function getTotalNews() {
		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "news");

		return $query->row['total'];
	}
	public function getNewsInfo($id)
	{
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "news WHERE new_id = ".$id);
		return $query->row;
	}
	public function getOtherNews($id)
	{
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "news WHERE new_id != ".$id." ORDER BY create_date DESC LIMIT 0,5");
		return $query->rows;
	}
}